package main.java.tmi.shipperstock.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import main.java.tmi.common.service.impl.AbstractDao;
import main.java.tmi.shipperstock.service.ShipperstockVO;

import org.springframework.stereotype.Repository;

/**
 * Shipperstock Data Access Object (cust Table)
 *
 * @author min™
 * @since 2012. 04. 24
 */
@Repository
public class ShipperstockDAO extends AbstractDao {
	
	/**
	 * Shipperstock search
	 * @return List<ShipperstockVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public List<ShipperstockVO> getShipperstockView(Map<String,String> param) throws SQLException {
				
		return (List<ShipperstockVO>) list("ShipperstockDAO.getShipperstockView", param);
	}
	
	/**
	 * Shipperstock search
	 * @return List<ShipperstockVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public int getShipperstockViewCount(Map<String,String> param) throws SQLException {
		return Integer.parseInt((String) getSqlMapClientTemplate().queryForObject("ShipperstockDAO.getShipperstockViewCount", param));
	}
	
	/**
	 * Shipperstock search
	 * @return List<ShipperstockVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public Map<String,String>  getShipperstockDetailView(Map<String,String> param) throws SQLException {
		Map<String,String> returnMap ;
        returnMap = (Map<String,String>) selectByPk("ShipperstockDAO.getShipperstockDetailView", param);
        
        return returnMap;
	}
	
	/**
	 * Shipperstock save
	 * @return void
	 * @throws SQLException 
	 */
	public void addShipperstock(Map<String,String> param) throws SQLException {
		insert("ShipperstockDAO.addShipperstock", param);
	}
	
	/**
	 * Shipperstock modify
	 * @return void
	 * @throws SQLException 
	 */
	public void modifyShipperstock(Map<String,String> param) throws SQLException {
		insert("ShipperstockDAO.modifyShipperstock", param);
	}
	
	/**
	 * Shipperstock del
	 * @return void
	 * @throws SQLException 
	 */
	public void delShipperstock(Map<String,String> param) throws SQLException {
		insert("ShipperstockDAO.delShipperstock", param);
	}	
}
